package com.umgsai.thread.thread01;

public class MyThread4 extends Thread {
	private int count = 5;

	@Override
	synchronized public void run() {
		super.run();
		count--;
		System.out.println("执行者：" + Thread.currentThread().getName() + ",count=" + count);
	}

	public static void main(String[] args) {
		MyThread4 myThread = new MyThread4();
		Thread t1 = new Thread(myThread, "A");
		Thread t2 = new Thread(myThread, "B");
		Thread t3 = new Thread(myThread, "C");
		Thread t4 = new Thread(myThread, "D");
		Thread t5 = new Thread(myThread, "E");
		t1.start();
		t2.start();
		t3.start();
		t4.start();
		t5.start();
	}
}
